﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ZhiJiao.Models.Entities.Enums;

namespace ZhiJiao.Models.Entities
{
    [Table("Modules")]
    public class Module: BaseEntity
    {
        /// <summary>
        /// 模块名称
        ///</summary>
        public string Name { get; set; }

        /// <summary>
        ///  Sn
        ///</summary>
        public string Sn { get; set; }

        /// <summary>
        ///  父ID
        ///</summary>
        public Module? ParentModule { get; set; }

        /// <summary>
        /// 子模块
        /// </summary>
        public List<Module>? Children { get; set; }
        /// <summary>
        /// 图标  
        ///</summary>
        public string Icon { get; set; }
        /// <summary>
        ///  
        ///</summary>
        public string? Url { get; set; }
        /// <summary>
        ///  
        ///</summary>
        public int SortNum { get; set; }
        /// <summary>
        /// 
        ///</summary>
        public bool Flag { get; set; }

        /// <summary>
        /// 是否为目录
        /// </summary>
        public bool IsDirectory { get; set; } = false;

        /// <summary>
        /// 模块类型
        /// </summary>
        public ModuleType Type { get; set; }

        public List<Role>? Roles { get; set; }

        public List<RoleModule>? RoleModules { get; set; }
    }
}
